package cn.edu.cqu.fredyvia.forum.entity;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author fredyvia
 * @since 2021-07-10
 */
@Data
@TableName("user_info")
public class UserInfo extends Model<UserInfo> {

    private static final long serialVersionUID = 1L;

    @TableId("user_id")
    @JSONField(name = "id")
    private Integer userId;

    private String avatar;

    private String userdetail;
    /**
     * 1是男，0是女，-1不明
     */
    private Integer sex;

    private Date birthday;

    private Integer score;

    @TableField(exist = false)
    private String username;

    @Override
    public Serializable pkVal() {
        return this.userId;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
